package com.hackerrank.challenges.detectthedomainname;

import java.util.Arrays;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class Solution {
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int N = in.nextInt();
		in.nextLine();
		Set<String> dn = new HashSet<String>();
		for(int i = 0; i < N; i++) {
			String s = in.nextLine();
			Matcher m = Pattern.compile("https?://((www|ww2)\\.)?([a-zA-Z0-9-]+(\\.[a-zA-Z0-9-]+)+)").matcher(s);
			while(m.find()) {
				String is = m.group().split("//")[1];
				if(is.startsWith("www.") || is.startsWith("ww2."))
					dn.add(is.substring(4));
				else
					dn.add(is);
			}
		}
		String dna[] = new String[dn.size()];
		dna = dn.toArray(dna);
		Arrays.sort(dna);
		if(dna.length > 0) {
			System.out.print(dna[0]);
			for(int i = 1; i < dna.length; i++)
				System.out.print(";" + dna[i]);
			System.out.println();
		}
	}
}
